package com.sckj.springboot.controller;


import com.sckj.springboot.entity.JsonResult;
import com.sckj.springboot.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/swagger2")
@Api(value = "swagger2在线接口文档")
public class TestController {
    @GetMapping("/user/{id}")
    @ApiOperation(value = "用户唯一标识符")
    public JsonResult<User> getUserInfo(@PathVariable @ApiParam(value = "用户唯一标识符") Integer id){

        User user = new User(id,"zhang","12345");
        return new JsonResult(user);
    }
}
